﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

public partial class ucTopik : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
		  if (!PAConfiguration.IsSuperUser(CurrentPage.Teacher.TEACHER_ID))
		  {
			  admin.HRef = "students.aspx";
		  }

      if ((Page as BasePage).IsAdminPage())
      {
        ucNavigation1.Visible = true;
        ucNavigation1.CurrentSection = (Page as BasePage).GetAdminPageName();
      }
      else
        ucNavigation1.Visible = false;


		//if (CurrentPage.Teacher.IS_ADMIN == 0)
		//{
		//    admin.HRef = string.Empty;
		//}

		//if (CurrentPage.Teacher.IS_CALL_CENTER == 1)
		//{
		//    sectionlink.HRef = string.Empty;
		//    entries.HRef = string.Empty;
		//    logentries.HRef = string.Empty;
		//    admin.HRef = "students.aspx";
		//}

		//sectionlink.Disabled = (CurrentPage.Teacher.IS_CALL_CENTER == 1);
		//entries.Disabled = (CurrentPage.Teacher.IS_CALL_CENTER == 1);
		//logentries.Disabled = (CurrentPage.Teacher.IS_CALL_CENTER == 1);
		//admin.Disabled = (CurrentPage.Teacher.IS_CALL_CENTER == 1);
    }

	public string Title { get; set; }


	public BasePage CurrentPage
	{
		get
		{
			return (BasePage)this.Page;
		}
	}
	protected void LinkButton1_Click(object sender, EventArgs e)
	{
		CookiesManager.DeleteCoolie(Response);
		FormsAuthentication.SignOut();
		Response.Redirect("~/login.aspx");

	}
}
